package cn.wolfcode.shop.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;

@Getter
@Setter
public class Property extends BaseDomain {

    public static final Integer TYPE_SELECT = 1; //下拉框
    public static final Integer TYPE_INPUT = 0;  //输入框

    private Long catalogId;

    private String name;

    private Integer sort;

    private Integer type;
    //list装属性值
    private List<PropertyValue> propertyValueList;

    public String getJsonData() {

        HashMap<String, Object> map = new HashMap();
        map.put("id", getId());
        map.put("catalogId", catalogId);
        map.put("name", name);
        map.put("sort", sort);
        map.put("type", type);

        return JSON.toJSONString(map);
    }

}